﻿
Ext.define('SHApp.ClientInfo.BagManage.PanelGrid', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.panelgrid',
    requires: ['SHApp.ClientInfo.BagManage.Grid', 'SHApp.ClientInfo.BagManage.InfoGrid'],
    layout: { type: "border" },
    basicGrid: null,
    gRole: null,
    pvalue: 0,
    initComponent: function () {
        var me = this;
        Ext.apply(this);
        this.createItem(); //初始化分页条
        this.callParent(arguments);
    },
    createItem: function () {
        var me = this;

        var basicGrid = Ext.create("SHApp.ClientInfo.BagManage.Grid", { title: "合同基本信息", flex: 1.1, pvalue: me.pvalue,
            region: "center"

        });

        basicGrid.on("selectionchange", function (model, records) {
            var Code = "";
            var CompanyID = "";
            if (records.length > 0) {
                Code = records[0].data.Code;
                CompanyID = records[0].data.CompanyID;
            }
            me.gRole.loadByUserID(Code, CompanyID);

        });

        this.basicGrid = basicGrid;

        var grid1 = Ext.create("SHApp.ClientInfo.BagManage.InfoGrid", {
            title: "合同包详细设置",
            // width: 400,
            flex: 1,
            split: true,
            region: "east",
            pvalue: me.pvalue
        });

        me.gRole = grid1;
        me.items = [me.basicGrid, me.gRole];
    }
})

